package com.bjpowernode.javase.collection.set;

import java.util.Arrays;
import java.util.HashSet;
import java.util.stream.Collectors;

public class SetTest0 {
    public static void main(String[] args) {
        int[] ids = new int[5];
        ids[0]=0;
        ids[1]=100;
        ids[3]=900;
        ids[4]=10000;
        ids[2]=5;
        HashSet<Integer> hashSet = new HashSet<>();
        for (int id : ids) {
            hashSet.add(id);
        }
        hashSet.forEach(System.out::println);
        hashSet.remove(0);
        System.out.println("=================");
        hashSet.forEach(System.out::println);
        System.out.println("====================");
        Object[] objects = hashSet.toArray();
        Arrays.stream(objects).forEach(System.out::println);
    }

}
